package Huihu.src.TcpandUdp;

import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;

//客户端
public class TcpClient {
    public static void main(String[] args) throws Exception {
        InetAddress inetAddress=InetAddress.getByName("127.0.0.1");
        int port=8899;
        Socket socket=new Socket(inetAddress,port);
        OutputStream os=socket.getOutputStream();
        os.write("中国你好".getBytes());
        os.close();
        socket.close();
    }
}
